<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:s="http://jboss.com/products/seam/taglib"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:rich="http://richfaces.org/rich"
    template="layout/template.xhtml">

<ui:define name="body">

    <rich:panel>
        <f:facet name="header">Projeto Details</f:facet>


        <s:decorate id="cliente" template="layout/display.xhtml">
            <ui:define name="label">Cliente</ui:define>
            <h:outputText value="#{projetoHome.instance.cliente}"/>
        </s:decorate>

        <s:decorate id="custoprevisto" template="layout/display.xhtml">
            <ui:define name="label">Custoprevisto</ui:define>
            <h:outputText value="#{projetoHome.instance.custoprevisto}"/>
        </s:decorate>

        <s:decorate id="datacriacao" template="layout/display.xhtml">
            <ui:define name="label">Datacriacao</ui:define>
            <h:outputText value="#{projetoHome.instance.datacriacao}">
                <s:convertDateTime type="both" dateStyle="short"/>
            </h:outputText>
        </s:decorate>

        <s:decorate id="fim" template="layout/display.xhtml">
            <ui:define name="label">Fim</ui:define>
            <h:outputText value="#{projetoHome.instance.fim}">
                <s:convertDateTime type="both" dateStyle="short"/>
            </h:outputText>
        </s:decorate>

        <s:decorate id="fimprevisto" template="layout/display.xhtml">
            <ui:define name="label">Fimprevisto</ui:define>
            <h:outputText value="#{projetoHome.instance.fimprevisto}">
                <s:convertDateTime type="both" dateStyle="short"/>
            </h:outputText>
        </s:decorate>

        <s:decorate id="inicio" template="layout/display.xhtml">
            <ui:define name="label">Inicio</ui:define>
            <h:outputText value="#{projetoHome.instance.inicio}">
                <s:convertDateTime type="both" dateStyle="short"/>
            </h:outputText>
        </s:decorate>

        <s:decorate id="justificativa" template="layout/display.xhtml">
            <ui:define name="label">Justificativa</ui:define>
            <h:outputText value="#{projetoHome.instance.justificativa}"/>
        </s:decorate>

        <s:decorate id="necessidades" template="layout/display.xhtml">
            <ui:define name="label">Necessidades</ui:define>
            <h:outputText value="#{projetoHome.instance.necessidades}"/>
        </s:decorate>

        <s:decorate id="nome" template="layout/display.xhtml">
            <ui:define name="label">Nome</ui:define>
            <h:outputText value="#{projetoHome.instance.nome}"/>
        </s:decorate>

        <s:decorate id="orcamento" template="layout/display.xhtml">
            <ui:define name="label">Orcamento</ui:define>
            <h:outputText value="#{projetoHome.instance.orcamento}"/>
        </s:decorate>

        <s:decorate id="premissas" template="layout/display.xhtml">
            <ui:define name="label">Premissas</ui:define>
            <h:outputText value="#{projetoHome.instance.premissas}"/>
        </s:decorate>

        <s:decorate id="produto" template="layout/display.xhtml">
            <ui:define name="label">Produto</ui:define>
            <h:outputText value="#{projetoHome.instance.produto}"/>
        </s:decorate>

        <s:decorate id="responsabilidadesgp" template="layout/display.xhtml">
            <ui:define name="label">Responsabilidadesgp</ui:define>
            <h:outputText value="#{projetoHome.instance.responsabilidadesgp}"/>
        </s:decorate>

        <s:decorate id="restricoes" template="layout/display.xhtml">
            <ui:define name="label">Restricoes</ui:define>
            <h:outputText value="#{projetoHome.instance.restricoes}"/>
        </s:decorate>

        <s:decorate id="resumo" template="layout/display.xhtml">
            <ui:define name="label">Resumo</ui:define>
            <h:outputText value="#{projetoHome.instance.resumo}"/>
        </s:decorate>

        <div style="clear:both"/>

    </rich:panel>

    <div class="actionButtons">

        <s:button view="/ProjetoEdit.xhtml"
                    id="edit"
                 value="Edit"/>

        <s:button view="/#{empty projetoFrom ? 'ProjetoList' : projetoFrom}.xhtml"
                    id="done"
                 value="Done"/>

    </div>

    <rich:tabPanel switchType="ajax">

    <rich:tab>
        <f:facet name="label">
            <h:panelGroup><h:graphicImage value="/img/manytoone.gif" style="vertical-align: middle; padding-right: 4px;"/>Statusprojeto</h:panelGroup>
        </f:facet>
    <div class="association" id="statusprojetoParent">

        <h:outputText value="There is no statusprojeto associated with this projeto."
                   rendered="#{projetoHome.instance.statusprojeto == null}"/>

        <rich:dataTable var="_statusprojeto"
                   value="#{projetoHome.instance.statusprojeto}"
                rendered="#{projetoHome.instance.statusprojeto != null}"
              rowClasses="rvgRowOne,rvgRowTwo"
                      id="statusprojetoTable">
            <h:column>
                <f:facet name="header">Id</f:facet>
                <h:outputText value="#{_statusprojeto.id}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Nome</f:facet>
                <h:outputText value="#{_statusprojeto.nome}"/>
            </h:column>
            <h:column styleClass="action">
                <f:facet name="header">Action</f:facet>
                <s:link id="viewstatusprojeto"
                     value="View"
                      view="/Statusprojeto.xhtml">
                    <f:param name="statusprojetoId"
                           value="#{_statusprojeto.id}"/>
                </s:link>
            </h:column>
        </rich:dataTable>

    </div>
    </rich:tab>

    <rich:tab>
        <f:facet name="label">
            <h:panelGroup><h:graphicImage value="/img/manytoone.gif" style="vertical-align: middle; padding-right: 4px;"/>Usuario</h:panelGroup>
        </f:facet>
    <div class="association" id="usuarioParent">

        <h:outputText value="There is no usuario associated with this projeto."
                   rendered="#{projetoHome.instance.usuario == null}"/>

        <rich:dataTable var="_usuario"
                   value="#{projetoHome.instance.usuario}"
                rendered="#{projetoHome.instance.usuario != null}"
              rowClasses="rvgRowOne,rvgRowTwo"
                      id="usuarioTable">
            <h:column>
                <f:facet name="header">Id</f:facet>
                <h:outputText value="#{_usuario.id}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Ddd</f:facet>
                <h:outputText value="#{_usuario.ddd}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Email</f:facet>
                <h:outputText value="#{_usuario.email}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Endereco</f:facet>
                <h:outputText value="#{_usuario.endereco}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Gp</f:facet>
                <h:outputText value="#{_usuario.gp}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Login</f:facet>
                <h:outputText value="#{_usuario.login}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Nome</f:facet>
                <h:outputText value="#{_usuario.nome}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Senha</f:facet>
                <h:outputText value="#{_usuario.senha}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Telefone</f:facet>
                <h:outputText value="#{_usuario.telefone}"/>
            </h:column>
            <h:column styleClass="action">
                <f:facet name="header">Action</f:facet>
                <s:link id="viewusuario"
                     value="View"
                      view="/Usuario.xhtml">
                    <f:param name="usuarioId"
                           value="#{_usuario.id}"/>
                </s:link>
            </h:column>
        </rich:dataTable>

    </div>
    </rich:tab>

    <rich:tab>
        <f:facet name="label">
            <h:panelGroup><h:graphicImage value="/img/onetomany.gif" style="vertical-align: middle; padding-right: 4px;"/>Stakeholders</h:panelGroup>
        </f:facet>
    <h:form styleClass="association" id="stakeholdersChildren">

        <h:outputText value="There are no stakeholders associated with this projeto."
                   rendered="#{empty projetoHome.stakeholders}"/>

        <rich:dataTable value="#{projetoHome.stakeholders}"
                       var="_stakeholder"
                  rendered="#{not empty projetoHome.stakeholders}"
                rowClasses="rvgRowOne,rvgRowTwo"
                        id="stakeholdersTable">
            <rich:column sortBy="#{_stakeholder.id}">
                <f:facet name="header">Id</f:facet>
                <h:outputText value="#{_stakeholder.id}"/>
            </rich:column>
            <rich:column sortBy="#{_stakeholder.ccb}">
                <f:facet name="header">Ccb</f:facet>
                <h:outputText value="#{_stakeholder.ccb}"/>
            </rich:column>
            <rich:column sortBy="#{_stakeholder.papel}">
                <f:facet name="header">Papel</f:facet>
                <h:outputText value="#{_stakeholder.papel}"/>
            </rich:column>
            <h:column>
                <f:facet name="header">Action</f:facet>
                <s:link id="selectstakeholder"
                     value="Select"
                      view="/Stakeholder.xhtml">
                    <f:param name="stakeholderId"
                            value="#{_stakeholder.id}"/>
                    <f:param name="stakeholderFrom" value="Projeto"/>
                </s:link>
            </h:column>
        </rich:dataTable>

    </h:form>

    <div class="actionButtons">
        <s:button
               value="Add stakeholder"
                view="/StakeholderEdit.xhtml">
            <f:param name="projetoId"
                    value="#{projetoHome.instance.id}"/>
            <f:param name="stakeholderFrom" value="Projeto"/>
        </s:button>
    </div>
    </rich:tab>

    <rich:tab>
        <f:facet name="label">
            <h:panelGroup><h:graphicImage value="/img/onetomany.gif" style="vertical-align: middle; padding-right: 4px;"/>Solicitacaomudancas</h:panelGroup>
        </f:facet>
    <h:form styleClass="association" id="solicitacaomudancasChildren">

        <h:outputText value="There are no solicitacaomudancas associated with this projeto."
                   rendered="#{empty projetoHome.solicitacaomudancas}"/>

        <rich:dataTable value="#{projetoHome.solicitacaomudancas}"
                       var="_solicitacaomudanca"
                  rendered="#{not empty projetoHome.solicitacaomudancas}"
                rowClasses="rvgRowOne,rvgRowTwo"
                        id="solicitacaomudancasTable">
            <rich:column sortBy="#{_solicitacaomudanca.id}">
                <f:facet name="header">Id</f:facet>
                <h:outputText value="#{_solicitacaomudanca.id}"/>
            </rich:column>
            <rich:column sortBy="#{_solicitacaomudanca.dataabertura}">
                <f:facet name="header">Dataabertura</f:facet>
                <h:outputText value="#{_solicitacaomudanca.dataabertura}">
                    <s:convertDateTime type="both" dateStyle="short"/>
                </h:outputText>
            </rich:column>
            <rich:column sortBy="#{_solicitacaomudanca.datafechamento}">
                <f:facet name="header">Datafechamento</f:facet>
                <h:outputText value="#{_solicitacaomudanca.datafechamento}">
                    <s:convertDateTime type="both" dateStyle="short"/>
                </h:outputText>
            </rich:column>
            <rich:column sortBy="#{_solicitacaomudanca.descricao}">
                <f:facet name="header">Descricao</f:facet>
                <h:outputText value="#{_solicitacaomudanca.descricao}"/>
            </rich:column>
            <rich:column sortBy="#{_solicitacaomudanca.justificativa}">
                <f:facet name="header">Justificativa</f:facet>
                <h:outputText value="#{_solicitacaomudanca.justificativa}"/>
            </rich:column>
            <rich:column sortBy="#{_solicitacaomudanca.titulo}">
                <f:facet name="header">Titulo</f:facet>
                <h:outputText value="#{_solicitacaomudanca.titulo}"/>
            </rich:column>
            <h:column>
                <f:facet name="header">Action</f:facet>
                <s:link id="selectsolicitacaomudanca"
                     value="Select"
                      view="/Solicitacaomudanca.xhtml">
                    <f:param name="solicitacaomudancaId"
                            value="#{_solicitacaomudanca.id}"/>
                    <f:param name="solicitacaomudancaFrom" value="Projeto"/>
                </s:link>
            </h:column>
        </rich:dataTable>

    </h:form>

    <div class="actionButtons">
        <s:button
               value="Add solicitacaomudanca"
                view="/SolicitacaomudancaEdit.xhtml">
            <f:param name="projetoId"
                    value="#{projetoHome.instance.id}"/>
            <f:param name="solicitacaomudancaFrom" value="Projeto"/>
        </s:button>
    </div>
    </rich:tab>

    <rich:tab>
        <f:facet name="label">
            <h:panelGroup><h:graphicImage value="/img/onetomany.gif" style="vertical-align: middle; padding-right: 4px;"/>Tarefas</h:panelGroup>
        </f:facet>
    <h:form styleClass="association" id="tarefasChildren">

        <h:outputText value="There are no tarefas associated with this projeto."
                   rendered="#{empty projetoHome.tarefas}"/>

        <rich:dataTable value="#{projetoHome.tarefas}"
                       var="_tarefa"
                  rendered="#{not empty projetoHome.tarefas}"
                rowClasses="rvgRowOne,rvgRowTwo"
                        id="tarefasTable">
            <rich:column sortBy="#{_tarefa.id}">
                <f:facet name="header">Id</f:facet>
                <h:outputText value="#{_tarefa.id}"/>
            </rich:column>
            <rich:column sortBy="#{_tarefa.fim}">
                <f:facet name="header">Fim</f:facet>
                <h:outputText value="#{_tarefa.fim}">
                    <s:convertDateTime type="both" dateStyle="short"/>
                </h:outputText>
            </rich:column>
            <rich:column sortBy="#{_tarefa.inicio}">
                <f:facet name="header">Inicio</f:facet>
                <h:outputText value="#{_tarefa.inicio}">
                    <s:convertDateTime type="both" dateStyle="short"/>
                </h:outputText>
            </rich:column>
            <rich:column sortBy="#{_tarefa.milestone}">
                <f:facet name="header">Milestone</f:facet>
                <h:outputText value="#{_tarefa.milestone}"/>
            </rich:column>
            <rich:column sortBy="#{_tarefa.nome}">
                <f:facet name="header">Nome</f:facet>
                <h:outputText value="#{_tarefa.nome}"/>
            </rich:column>
            <rich:column sortBy="#{_tarefa.porcentcomp}">
                <f:facet name="header">Porcentcomp</f:facet>
                <h:outputText value="#{_tarefa.porcentcomp}"/>
            </rich:column>
            <h:column>
                <f:facet name="header">Action</f:facet>
                <s:link id="selecttarefa"
                     value="Select"
                      view="/Tarefa.xhtml">
                    <f:param name="tarefaId"
                            value="#{_tarefa.id}"/>
                    <f:param name="tarefaFrom" value="Projeto"/>
                </s:link>
            </h:column>
        </rich:dataTable>

    </h:form>

    <div class="actionButtons">
        <s:button
               value="Add tarefa"
                view="/TarefaEdit.xhtml">
            <f:param name="projetoId"
                    value="#{projetoHome.instance.id}"/>
            <f:param name="tarefaFrom" value="Projeto"/>
        </s:button>
    </div>
    </rich:tab>

    <rich:tab>
        <f:facet name="label">
            <h:panelGroup><h:graphicImage value="/img/onetomany.gif" style="vertical-align: middle; padding-right: 4px;"/>Licoeses</h:panelGroup>
        </f:facet>
    <h:form styleClass="association" id="licoesesChildren">

        <h:outputText value="There are no licoeses associated with this projeto."
                   rendered="#{empty projetoHome.licoeses}"/>

        <rich:dataTable value="#{projetoHome.licoeses}"
                       var="_licoes"
                  rendered="#{not empty projetoHome.licoeses}"
                rowClasses="rvgRowOne,rvgRowTwo"
                        id="licoesesTable">
            <rich:column sortBy="#{_licoes.id}">
                <f:facet name="header">Id</f:facet>
                <h:outputText value="#{_licoes.id}"/>
            </rich:column>
            <rich:column sortBy="#{_licoes.descricao}">
                <f:facet name="header">Descricao</f:facet>
                <h:outputText value="#{_licoes.descricao}"/>
            </rich:column>
            <rich:column sortBy="#{_licoes.titulo}">
                <f:facet name="header">Titulo</f:facet>
                <h:outputText value="#{_licoes.titulo}"/>
            </rich:column>
            <h:column>
                <f:facet name="header">Action</f:facet>
                <s:link id="selectlicoes"
                     value="Select"
                      view="/Licoes.xhtml">
                    <f:param name="licoesId"
                            value="#{_licoes.id}"/>
                    <f:param name="licoesFrom" value="Projeto"/>
                </s:link>
            </h:column>
        </rich:dataTable>

    </h:form>

    <div class="actionButtons">
        <s:button
               value="Add licoes"
                view="/LicoesEdit.xhtml">
            <f:param name="projetoId"
                    value="#{projetoHome.instance.id}"/>
            <f:param name="licoesFrom" value="Projeto"/>
        </s:button>
    </div>
    </rich:tab>
</rich:tabPanel>
</ui:define>

</ui:composition>
